package com.link2room.bumblebee.controller.inside;

import com.link2room.bumblebee.dto.param.base.SysNoBaseParamDto;
import com.link2room.bumblebee.facade.ISysNoFacadeService;
import com.link2room.common.dto.result.base.BaseResultDto;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @author sqj88
 * @date 2018/1/22 14:46
 */
@Api(tags = "单号服务")
@RestController
@RequestMapping("/in/SysNos")
public class SysNoInsideController {
    @Resource
    private ISysNoFacadeService sysNoFacadeService;

    @ApiOperation(value = "获取单号")
    @ApiImplicitParam(name = "codes",value = "单号类型", paramType = "query", required = true)
    @RequestMapping(method= RequestMethod.GET)
    public @ResponseBody
    BaseResultDto getSysNo(
            @RequestParam(value = "noType",required = true)String noType
    ) throws Exception {
        SysNoBaseParamDto sysNoBaseParamDto=new SysNoBaseParamDto();
        sysNoBaseParamDto.setNoType(noType);
        BaseResultDto baseResultDto=new BaseResultDto();
        baseResultDto.setResultCode(0);
        baseResultDto.setResultInfo(sysNoFacadeService.getNo(sysNoBaseParamDto));
        return baseResultDto;
    }
}
